Page({
	data: {
		username: '',
		gender: ''
	},
	onLoad: function (data) {
		data.username = decodeURIComponent(data.username);
		data.gender = decodeURIComponent(data.gender);
		this.setData(data);
	},
	saveInfo: function (e) {
		var formData = e.detail.value;
		let pages = getCurrentPages();
		let prevPage = pages[pages.length - 2];
		
		prevPage.setData({
			username: formData.username,
			gender: formData.gender
		})
		
		wx.navigateBack();
	},
})